<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__CSS__/layui.css">
    <link rel="stylesheet" href="__CSS__/view.css"/>
    <link rel="icon" href="/favicon.ico">
    <title>新增银行卡</title>
</head>
<body class="layui-view-body">
<div class="layui-content">
    <div class="layui-row">
        <div class="layui-card">
            <div class="layui-form layui-card-body" id="doform">
                <div class="layui-form-item">
                    <label class="layui-form-label">开户人</label>
                    <div class="layui-input-block">
                        <input type="text" name="card_name" required="" lay-verify="required" placeholder="请输入开户人姓名"
                               autocomplete="off" id="card_name" value="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">所属银行</label>
                    <div class="layui-input-block">
                        <select name="card_bank_id" lay-verify="required">
                            <option value=""></option>
                            {volist name="bank" id="vo"}
                            <option value="{$vo.list_id}">{$vo.list_name}</option>
                            {/volist}

                        </select>

                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">银行卡号</label>
                    <div class="layui-input-block">
                        <input type="text" name="card_no" required="" lay-verify="required" placeholder="请输入卡号"
                               autocomplete="off" value="" id="card_no" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">预留电话</label>
                    <div class="layui-input-block">
                        <input type="text" name="card_phone" required="" lay-verify="required" placeholder="请输入银行预留电话"
                               autocomplete="off" value="" id="card_phone" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">开户省</label>
                    <div class="layui-input-inline">
                        <input type="text" name="card_province" required="" value="" id="card_province"
                               lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                <label class="layui-form-label">开户市</label>
                    <div class="layui-input-inline">
                        <input type="text" name="card_city" required="" value="" id="card_city" lay-verify="required"
                               placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">开户支行</label>
                        <div class="layui-input-inline">
                            <input type="text" name="bankcodename" required="" value="{$vs['bankcodename']}" id="bankcodename"
                                   lay-verify="required" placeholder="例：中国银行股份有限公司北京乐成中心支行" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <a id="formDemo" class="layui-btn layui-btn-blue" lay-submit="" lay-filter="formDemo">保存</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="__JS__/layui.all.js"></script>
<script src="__JS__/jquery.min.js"></script>

<script>

    $('#formDemo').click(function () {
        var urls = "{:Url('member/Withdrwal/crdsadd')}";
        var data = $('#doform').serialize();

        $.post(urls, data, function (e) {
            if (e.error == 0) {
                layer.msg(e.msg);
                setTimeout(function () {
                    // location.reload();
                    parent.location.reload();
                }, 1500)
            } else if (e.error == 1) {
                layer.msg(e.msg);
            }
        });
    });

</script>

</body>
</html>